<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>1-5</title>
    <script src="../js/jquery-3.1.1.min.js"></script>
    <style>
        #div1{
            width: 300px;
            height: 300px;
            margin:0 auto;
            background-color: black;
            color: white;


        }
    </style>
    <script>
        $(function () {
            $('#div1').on({
                'mouseenter':function(event){
                   $('#div1').css({
                       'background-color':'white',
                       'color':'red',
                       'border':'10px solid red',
                   }) },
                'mouseleave':function(event){
                    $('#div1').css({
                        'background-color':'black',
                        'color':'white',
                        'border':'10px solid black',
                    }) }
            })
        })
    </script>

</head>
<body>
<div id="div1">鼠标移入改变样式 鼠标移出改变样式 </div>
</body>
</html>